package com.demo.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.demo.pojo.Order;
import com.demo.service.dto.OrderLinkProductDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-10-12
 */
public interface OrderMapper extends BaseMapper<Order> {


    List<Order> selectAllData();

    @Select(" SELECT ${ew.sqlSelect} FROM `t_order` o " +
            " LEFT JOIN `t_product` p ON o.product_id = p.id " +
            " ${ew.customSqlSegment}")
    List<OrderLinkProductDto> selectListLinkProduct(@Param(Constants.WRAPPER) Wrapper<Order> queryWrapper);


}
